<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module Bundler::SharedHelpers - bundler: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-i-bundler_ruby_lib">#bundler_ruby_lib</a>
    <li ><a href="#method-i-chdir">#chdir</a>
    <li ><a href="#method-i-clean_load_path">#clean_load_path</a>
    <li ><a href="#method-i-default_bundle_dir">#default_bundle_dir</a>
    <li ><a href="#method-i-default_gemfile">#default_gemfile</a>
    <li ><a href="#method-i-default_lockfile">#default_lockfile</a>
    <li ><a href="#method-i-digest">#digest</a>
    <li ><a href="#method-i-ensure_same_dependencies">#ensure_same_dependencies</a>
    <li ><a href="#method-i-filesystem_access">#filesystem_access</a>
    <li ><a href="#method-i-find_directory">#find_directory</a>
    <li ><a href="#method-i-find_file">#find_file</a>
    <li ><a href="#method-i-find_gemfile">#find_gemfile</a>
    <li ><a href="#method-i-gemfile_names">#gemfile_names</a>
    <li ><a href="#method-i-in_bundle-3F">#in_bundle?</a>
    <li ><a href="#method-i-major_deprecation">#major_deprecation</a>
    <li ><a href="#method-i-md5_available-3F">#md5_available?</a>
    <li ><a href="#method-i-pretty_dependency">#pretty_dependency</a>
    <li ><a href="#method-i-print_major_deprecations-21">#print_major_deprecations!</a>
    <li ><a href="#method-i-prints_major_deprecations-3F">#prints_major_deprecations?</a>
    <li ><a href="#method-i-pwd">#pwd</a>
    <li ><a href="#method-i-resolve_path">#resolve_path</a>
    <li ><a href="#method-i-root">#root</a>
    <li ><a href="#method-i-search_up">#search_up</a>
    <li ><a href="#method-i-set_bundle_environment">#set_bundle_environment</a>
    <li ><a href="#method-i-set_bundle_variables">#set_bundle_variables</a>
    <li ><a href="#method-i-set_env">#set_env</a>
    <li ><a href="#method-i-set_path">#set_path</a>
    <li ><a href="#method-i-set_rubylib">#set_rubylib</a>
    <li ><a href="#method-i-set_rubyopt">#set_rubyopt</a>
    <li ><a href="#method-i-validate_bundle_path">#validate_bundle_path</a>
    <li ><a href="#method-i-with_clean_git_env">#with_clean_git_env</a>
    <li ><a href="#method-i-write_to_gemfile">#write_to_gemfile</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-Bundler::SharedHelpers">
    <h1 id="module-Bundler::SharedHelpers" class="module">
      module Bundler::SharedHelpers
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">





                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-chdir" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">chdir</span><span
                                class="method-args">(dir, &amp;blk)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="chdir-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 50</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">chdir</span>(<span class="ruby-identifier">dir</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>)
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">ext_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword">do</span>
    <span class="ruby-constant">Dir</span>.<span class="ruby-identifier">chdir</span> <span class="ruby-identifier">dir</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">blk</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-default_bundle_dir" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_bundle_dir</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_bundle_dir-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 34</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_bundle_dir</span>
  <span class="ruby-identifier">bundle_dir</span> = <span class="ruby-identifier">find_directory</span>(<span class="ruby-string">&quot;.bundle&quot;</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bundle_dir</span>

  <span class="ruby-identifier">bundle_dir</span> = <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">bundle_dir</span>)

  <span class="ruby-identifier">global_bundle_dir</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">user_home</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;.bundle&quot;</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">bundle_dir</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">global_bundle_dir</span>

  <span class="ruby-identifier">bundle_dir</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-default_gemfile" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_gemfile</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_gemfile-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 19</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_gemfile</span>
  <span class="ruby-identifier">gemfile</span> = <span class="ruby-identifier">find_gemfile</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemfileNotFound</span>, <span class="ruby-string">&quot;Could not locate Gemfile&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">gemfile</span>
  <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">gemfile</span>).<span class="ruby-identifier">tap</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_VERSION</span> <span class="ruby-operator">&lt;</span> <span class="ruby-string">&quot;2.7&quot;</span> }.<span class="ruby-identifier">expand_path</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-default_lockfile" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">default_lockfile</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="default_lockfile-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 25</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">default_lockfile</span>
  <span class="ruby-identifier">gemfile</span> = <span class="ruby-identifier">default_gemfile</span>

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">gemfile</span>.<span class="ruby-identifier">basename</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&quot;gems.rb&quot;</span> <span class="ruby-keyword">then</span> <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">gemfile</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp">/.rb$/</span>, <span class="ruby-string">&quot;.locked&quot;</span>))
  <span class="ruby-keyword">else</span> <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{gemfile}.lock&quot;</span>)
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">tap</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_VERSION</span> <span class="ruby-operator">&lt;</span> <span class="ruby-string">&quot;2.7&quot;</span> }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-digest" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">digest</span><span
                                class="method-args">(name)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="digest-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 191</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">digest</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;digest&quot;</span>
  <span class="ruby-constant">Digest</span>(<span class="ruby-identifier">name</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ensure_same_dependencies" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ensure_same_dependencies</span><span
                                class="method-args">(spec, old_deps, new_deps)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ensure_same_dependencies-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 148</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ensure_same_dependencies</span>(<span class="ruby-identifier">spec</span>, <span class="ruby-identifier">old_deps</span>, <span class="ruby-identifier">new_deps</span>)
  <span class="ruby-identifier">new_deps</span> = <span class="ruby-identifier">new_deps</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:development</span> }
  <span class="ruby-identifier">old_deps</span> = <span class="ruby-identifier">old_deps</span>.<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:development</span> }

  <span class="ruby-identifier">without_type</span> = <span class="ruby-identifier">proc</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">d</span>.<span class="ruby-identifier">requirements_list</span>.<span class="ruby-identifier">sort</span>) }
  <span class="ruby-identifier">new_deps</span>.<span class="ruby-identifier">map!</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">without_type</span>)
  <span class="ruby-identifier">old_deps</span>.<span class="ruby-identifier">map!</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">without_type</span>)

  <span class="ruby-identifier">extra_deps</span> = <span class="ruby-identifier">new_deps</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">old_deps</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">extra_deps</span>.<span class="ruby-identifier">empty?</span>

  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">debug</span> <span class="ruby-node">&quot;#{spec.full_name} from #{spec.remote} has either corrupted API or lockfile dependencies&quot;</span> \
    <span class="ruby-node">&quot; (was expecting #{old_deps.map(&amp;:to_s)}, but the real spec has #{new_deps.map(&amp;:to_s)})&quot;</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">APIResponseMismatchError</span>,
    <span class="ruby-node">&quot;Downloading #{spec.full_name} revealed dependencies not in the API or the lockfile (#{extra_deps.join(&quot;, &quot;)}).&quot;</span> \
    <span class="ruby-node">&quot;\nRunning `bundle update #{spec.name}` should fix the problem.&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-filesystem_access" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">filesystem_access</span><span
                                class="method-args">(path, action = :write) { |dup.tap {|x| untaint| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Rescues permissions errors raised by file system operations (ie. Errno:EACCESS, Errno::EAGAIN) and raises more friendly errors instead.</p>

<p>@param path [String] the path that the action will be attempted to @param action [Symbol, to_s] the type of operation that will be</p>

<pre>performed. For example: :write, :read, :exec</pre>

<p>@yield path</p>

<p>@raise [Bundler::PermissionError] if Errno:EACCES is raised in the</p>

<pre class="ruby"><span class="ruby-identifier">given</span> <span class="ruby-identifier">block</span>
</pre>

<p>@raise [Bundler::TemporaryResourceError] if Errno:EAGAIN is raised in the</p>

<pre class="ruby"><span class="ruby-identifier">given</span> <span class="ruby-identifier">block</span>
</pre>

<p>@example</p>

<pre class="ruby"><span class="ruby-identifier">filesystem_access</span>(<span class="ruby-string">&quot;vendor/cache&quot;</span>, <span class="ruby-value">:write</span>) <span class="ruby-keyword">do</span>
  <span class="ruby-constant">FileUtils</span>.<span class="ruby-identifier">mkdir_p</span>(<span class="ruby-string">&quot;vendor/cache&quot;</span>)
<span class="ruby-keyword">end</span>
</pre>

<p>@see {Bundler::PermissionError}</p>

                              <div class="method-source-code" id="filesystem_access-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 102</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">filesystem_access</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">action</span> = <span class="ruby-value">:write</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-keyword">yield</span>(<span class="ruby-identifier">path</span>.<span class="ruby-identifier">dup</span>.<span class="ruby-identifier">tap</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_VERSION</span> <span class="ruby-operator">&lt;</span> <span class="ruby-string">&quot;2.7&quot;</span> })
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EACCES</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">PermissionError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">action</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EAGAIN</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">TemporaryResourceError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">action</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EPROTO</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">VirtualProtocolError</span>.<span class="ruby-identifier">new</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOSPC</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">NoSpaceOnDeviceError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">action</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOTSUP</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">OperationNotSupportedError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">path</span>, <span class="ruby-identifier">action</span>)
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">EEXIST</span>, <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
  <span class="ruby-identifier">raise</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">SystemCallError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">GenericSystemCallError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">e</span>, <span class="ruby-node">&quot;There was an error accessing `#{path}`.&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-in_bundle-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">in_bundle?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="in_bundle-3F-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 46</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">in_bundle?</span>
  <span class="ruby-identifier">find_gemfile</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-major_deprecation" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">major_deprecation</span><span
                                class="method-args">(major_version, message, print_caller_location: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="major_deprecation-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 120</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">major_deprecation</span>(<span class="ruby-identifier">major_version</span>, <span class="ruby-identifier">message</span>, <span class="ruby-value">print_caller_location:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">print_caller_location</span>
    <span class="ruby-identifier">caller_location</span> = <span class="ruby-identifier">caller_locations</span>(<span class="ruby-value">2</span>, <span class="ruby-value">2</span>).<span class="ruby-identifier">first</span>
    <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;#{message} (called at #{caller_location.path}:#{caller_location.lineno})&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">bundler_major_version</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">bundler_major_version</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">bundler_major_version</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">major_version</span>
    <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;errors&quot;</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">DeprecatedError</span>, <span class="ruby-node">&quot;[REMOVED] #{message}&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bundler_major_version</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-identifier">major_version</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">prints_major_deprecations?</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span>(<span class="ruby-node">&quot;[DEPRECATED] #{message}&quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-md5_available-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">md5_available?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="md5_available-3F-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 178</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">md5_available?</span>
  <span class="ruby-keyword">return</span> <span class="ruby-ivar">@md5_available</span> <span class="ruby-keyword">if</span> <span class="ruby-keyword">defined?</span>(<span class="ruby-ivar">@md5_available</span>)
  <span class="ruby-ivar">@md5_available</span> = <span class="ruby-keyword">begin</span>
    <span class="ruby-identifier">require</span> <span class="ruby-string">&quot;openssl&quot;</span>
    <span class="ruby-operator">::</span><span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span>.<span class="ruby-identifier">digest</span>(<span class="ruby-string">&quot;MD5&quot;</span>, <span class="ruby-string">&quot;&quot;</span>)
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">LoadError</span>
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-operator">::</span><span class="ruby-constant">OpenSSL</span><span class="ruby-operator">::</span><span class="ruby-constant">Digest</span><span class="ruby-operator">::</span><span class="ruby-constant">DigestError</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pretty_dependency" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pretty_dependency</span><span
                                class="method-args">(dep)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="pretty_dependency-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 166</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pretty_dependency</span>(<span class="ruby-identifier">dep</span>)
  <span class="ruby-identifier">msg</span> = <span class="ruby-constant">String</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">dep</span>.<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; (#{dep.requirement})&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">requirement</span> <span class="ruby-operator">==</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Requirement</span>.<span class="ruby-identifier">default</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">Dependency</span>)
    <span class="ruby-identifier">platform_string</span> = <span class="ruby-identifier">dep</span>.<span class="ruby-identifier">platforms</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;, &quot;</span>)
    <span class="ruby-identifier">msg</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">platform_string</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">platform_string</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">platform_string</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Gem</span><span class="ruby-operator">::</span><span class="ruby-constant">Platform</span><span class="ruby-operator">::</span><span class="ruby-constant">RUBY</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">msg</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-print_major_deprecations-21" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">print_major_deprecations!</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="print_major_deprecations-21-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 136</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">print_major_deprecations!</span>
  <span class="ruby-identifier">multiple_gemfiles</span> = <span class="ruby-identifier">search_up</span>(<span class="ruby-string">&quot;.&quot;</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dir</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">gemfiles</span> = <span class="ruby-identifier">gemfile_names</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">gf</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">gf</span>, <span class="ruby-identifier">dir</span>) }
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">gemfiles</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">break</span> <span class="ruby-identifier">gemfiles</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">!=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">multiple_gemfiles</span>
  <span class="ruby-identifier">message</span> = <span class="ruby-string">&quot;Multiple gemfiles (gems.rb and Gemfile) detected. &quot;</span> \
            <span class="ruby-string">&quot;Make sure you remove Gemfile and Gemfile.lock since bundler is ignoring them in favor of gems.rb and gems.locked.&quot;</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">ui</span>.<span class="ruby-identifier">warn</span> <span class="ruby-identifier">message</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pwd" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pwd</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="pwd-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 56</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pwd</span>
  <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">ext_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword">do</span>
    <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">pwd</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-root" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">root</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="root-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 13</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">root</span>
  <span class="ruby-identifier">gemfile</span> = <span class="ruby-identifier">find_gemfile</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">GemfileNotFound</span>, <span class="ruby-string">&quot;Could not locate Gemfile&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">gemfile</span>
  <span class="ruby-constant">Pathname</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">gemfile</span>).<span class="ruby-identifier">tap</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_VERSION</span> <span class="ruby-operator">&lt;</span> <span class="ruby-string">&quot;2.7&quot;</span> }.<span class="ruby-identifier">expand_path</span>.<span class="ruby-identifier">parent</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_bundle_environment" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_bundle_environment</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_bundle_environment-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 75</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_bundle_environment</span>
  <span class="ruby-identifier">set_bundle_variables</span>
  <span class="ruby-identifier">set_path</span>
  <span class="ruby-identifier">set_rubyopt</span>
  <span class="ruby-identifier">set_rubylib</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_env</span><span
                                class="method-args">(key, value)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_env-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 263</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_env</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;new key #{key}&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">EnvironmentPreserver</span><span class="ruby-operator">::</span><span class="ruby-constant">BUNDLER_KEYS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">key</span>)
  <span class="ruby-identifier">orig_key</span> = <span class="ruby-node">&quot;#{EnvironmentPreserver::BUNDLER_PREFIX}#{key}&quot;</span>
  <span class="ruby-identifier">orig</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">key</span>]
  <span class="ruby-identifier">orig</span> <span class="ruby-operator">||=</span> <span class="ruby-constant">EnvironmentPreserver</span><span class="ruby-operator">::</span><span class="ruby-constant">INTENTIONALLY_NIL</span>
  <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">orig_key</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">orig</span>

  <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">value</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-with_clean_git_env" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">with_clean_git_env</span><span
                                class="method-args">(&amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="with_clean_git_env-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 62</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">with_clean_git_env</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">keys</span>    = <span class="ruby-node">%w[GIT_DIR GIT_WORK_TREE]</span>
  <span class="ruby-identifier">old_env</span> = <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">inject</span>({}) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">h</span>.<span class="ruby-identifier">update</span>(<span class="ruby-identifier">k</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">k</span>])
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-constant">ENV</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>) }

  <span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-identifier">keys</span>.<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">key</span><span class="ruby-operator">|</span> <span class="ruby-constant">ENV</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">old_env</span>[<span class="ruby-identifier">key</span>] }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-write_to_gemfile" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">write_to_gemfile</span><span
                                class="method-args">(gemfile_path, contents)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="write_to_gemfile-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 196</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">write_to_gemfile</span>(<span class="ruby-identifier">gemfile_path</span>, <span class="ruby-identifier">contents</span>)
  <span class="ruby-identifier">filesystem_access</span>(<span class="ruby-identifier">gemfile_path</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">g</span><span class="ruby-operator">|</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">g</span>, <span class="ruby-string">&quot;w&quot;</span>) {<span class="ruby-operator">|</span><span class="ruby-identifier">file</span><span class="ruby-operator">|</span> <span class="ruby-identifier">file</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">contents</span> } }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-bundler_ruby_lib" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">bundler_ruby_lib</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="bundler_ruby_lib-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 311</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bundler_ruby_lib</span>
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;..&quot;</span>, <span class="ruby-identifier">__dir__</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clean_load_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clean_load_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clean_load_path-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 315</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clean_load_path</span>
  <span class="ruby-identifier">loaded_gem_paths</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">loaded_gem_paths</span>

  <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">reject!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">p</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">resolved_path</span> = <span class="ruby-identifier">resolve_path</span>(<span class="ruby-identifier">p</span>)
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">$LOADED_FEATURES</span>.<span class="ruby-identifier">any?</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">lf</span><span class="ruby-operator">|</span> <span class="ruby-identifier">lf</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-identifier">resolved_path</span>) }
    <span class="ruby-identifier">loaded_gem_paths</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">p</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">uniq!</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-find_directory" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">find_directory</span><span
                                class="method-args">(*names)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="find_directory-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 230</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">find_directory</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">names</span>)
  <span class="ruby-identifier">search_up</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">names</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">dirname</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">dirname</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">dirname</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-find_file" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">find_file</span><span
                                class="method-args">(*names)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="find_file-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 224</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">find_file</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">names</span>)
  <span class="ruby-identifier">search_up</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">names</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">filename</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">filename</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-identifier">filename</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-find_gemfile" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">find_gemfile</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="find_gemfile-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 214</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">find_gemfile</span>
  <span class="ruby-identifier">given</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLE_GEMFILE&quot;</span>]
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">given</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">given</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">given</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">find_file</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">gemfile_names</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-gemfile_names" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">gemfile_names</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="gemfile_names-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 220</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">gemfile_names</span>
  [<span class="ruby-string">&quot;gems.rb&quot;</span>, <span class="ruby-string">&quot;Gemfile&quot;</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prints_major_deprecations-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prints_major_deprecations?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="prints_major_deprecations-3F-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 333</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prints_major_deprecations?</span>
  <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;../bundler&quot;</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">settings</span>[<span class="ruby-value">:silence_deprecations</span>]
  <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&quot;deprecate&quot;</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">Deprecate</span>.<span class="ruby-identifier">skip</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_path</span><span
                                class="method-args">(path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_path-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 326</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_path</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">expanded</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">expanded</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">expanded</span>)

  <span class="ruby-constant">File</span>.<span class="ruby-identifier">realpath</span>(<span class="ruby-identifier">expanded</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-search_up" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">search_up</span><span
                                class="method-args">(*names) { |filename| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="search_up-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 236</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">search_up</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">names</span>)
  <span class="ruby-identifier">previous</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">current</span>  = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">pwd</span>).<span class="ruby-identifier">tap</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">x</span><span class="ruby-operator">|</span> <span class="ruby-identifier">x</span>.<span class="ruby-identifier">untaint</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">RUBY_VERSION</span> <span class="ruby-operator">&lt;</span> <span class="ruby-string">&quot;2.7&quot;</span> }

  <span class="ruby-keyword">until</span> <span class="ruby-operator">!</span><span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">current</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">current</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">previous</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;BUNDLER_SPEC_RUN&quot;</span>]
      <span class="ruby-comment"># avoid stepping above the tmp directory when testing</span>
      <span class="ruby-identifier">gemspec</span> = <span class="ruby-keyword">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;GEM_COMMAND&quot;</span>]
        <span class="ruby-comment"># for Ruby Core</span>
        <span class="ruby-string">&quot;lib/bundler/bundler.gemspec&quot;</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-string">&quot;bundler.gemspec&quot;</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-comment"># avoid stepping above the tmp directory when testing</span>
      <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">file?</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">current</span>, <span class="ruby-identifier">gemspec</span>))
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">filename</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">current</span>, <span class="ruby-identifier">name</span>)
      <span class="ruby-keyword">yield</span> <span class="ruby-identifier">filename</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">previous</span> = <span class="ruby-identifier">current</span>
    <span class="ruby-identifier">current</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;..&quot;</span>, <span class="ruby-identifier">current</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_bundle_variables" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_bundle_variables</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_bundle_variables-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 274</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_bundle_variables</span>
  <span class="ruby-comment"># bundler exe &amp; lib folders have same root folder, typical gem installation</span>
  <span class="ruby-identifier">exe_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;../../exe/bundle&quot;</span>, <span class="ruby-identifier">__dir__</span>)

  <span class="ruby-comment"># for Ruby core repository testing</span>
  <span class="ruby-identifier">exe_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;../../libexec/bundle&quot;</span>, <span class="ruby-identifier">__dir__</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">exe_file</span>)

  <span class="ruby-comment"># bundler is a default gem, exe path is separate</span>
  <span class="ruby-identifier">exe_file</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">bin_path</span>(<span class="ruby-string">&quot;bundler&quot;</span>, <span class="ruby-string">&quot;bundle&quot;</span>, <span class="ruby-constant">VERSION</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">exe_file</span>)

  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">set_env</span> <span class="ruby-string">&quot;BUNDLE_BIN_PATH&quot;</span>, <span class="ruby-identifier">exe_file</span>
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">set_env</span> <span class="ruby-string">&quot;BUNDLE_GEMFILE&quot;</span>, <span class="ruby-identifier">find_gemfile</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">set_env</span> <span class="ruby-string">&quot;BUNDLER_VERSION&quot;</span>, <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">set_env</span> <span class="ruby-string">&quot;BUNDLER_SETUP&quot;</span>, <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-string">&quot;setup&quot;</span>, <span class="ruby-identifier">__dir__</span>) <span class="ruby-keyword">unless</span> <span class="ruby-constant">RUBY_VERSION</span> <span class="ruby-operator">&lt;</span> <span class="ruby-string">&quot;2.7&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_path-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 290</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_path</span>
  <span class="ruby-identifier">validate_bundle_path</span>
  <span class="ruby-identifier">paths</span> = (<span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;PATH&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&quot;&quot;</span>).<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>)
  <span class="ruby-identifier">paths</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-node">&quot;#{Bundler.bundle_path}/bin&quot;</span>
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">set_env</span> <span class="ruby-string">&quot;PATH&quot;</span>, <span class="ruby-identifier">paths</span>.<span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_rubylib" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_rubylib</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_rubylib-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 305</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_rubylib</span>
  <span class="ruby-identifier">rubylib</span> = (<span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;RUBYLIB&quot;</span>] <span class="ruby-operator">||</span> <span class="ruby-string">&quot;&quot;</span>).<span class="ruby-identifier">split</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>)
  <span class="ruby-identifier">rubylib</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">bundler_ruby_lib</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">RbConfig</span><span class="ruby-operator">::</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-string">&quot;rubylibdir&quot;</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">bundler_ruby_lib</span>
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">set_env</span> <span class="ruby-string">&quot;RUBYLIB&quot;</span>, <span class="ruby-identifier">rubylib</span>.<span class="ruby-identifier">uniq</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH_SEPARATOR</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_rubyopt" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_rubyopt</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_rubyopt-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 297</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_rubyopt</span>
  <span class="ruby-identifier">rubyopt</span> = [<span class="ruby-constant">ENV</span>[<span class="ruby-string">&quot;RUBYOPT&quot;</span>]].<span class="ruby-identifier">compact</span>
  <span class="ruby-identifier">setup_require</span> = <span class="ruby-node">&quot;-r#{File.expand_path(&quot;setup&quot;, __dir__)}&quot;</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">rubyopt</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">rubyopt</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/#{setup_require}/</span>
  <span class="ruby-identifier">rubyopt</span>.<span class="ruby-identifier">unshift</span> <span class="ruby-identifier">setup_require</span>
  <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">SharedHelpers</span>.<span class="ruby-identifier">set_env</span> <span class="ruby-string">&quot;RUBYOPT&quot;</span>, <span class="ruby-identifier">rubyopt</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot; &quot;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-validate_bundle_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">validate_bundle_path</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="validate_bundle_path-source">
            <pre><span class="ruby-comment"># File bundler/shared_helpers.rb, line 202</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">validate_bundle_path</span>
  <span class="ruby-identifier">path_separator</span> = <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">rubygems</span>.<span class="ruby-identifier">path_separator</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Bundler</span>.<span class="ruby-identifier">bundle_path</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">path_separator</span>).<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>
  <span class="ruby-identifier">message</span> = <span class="ruby-node">&quot;Your bundle path contains text matching #{path_separator.inspect}, &quot;</span> \
            <span class="ruby-string">&quot;which is the path separator for your system. Bundler cannot &quot;</span> \
            <span class="ruby-string">&quot;function correctly when the Bundle path contains the &quot;</span> \
            <span class="ruby-string">&quot;system&#39;s PATH separator. Please change your &quot;</span> \
            <span class="ruby-node">&quot;bundle path to not match #{path_separator.inspect}.&quot;</span> \
            <span class="ruby-node">&quot;\nYour current bundle path is &#39;#{Bundler.bundle_path}&#39;.&quot;</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">PathError</span>, <span class="ruby-identifier">message</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

